home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 6
/
The Arsenal Files 6 (Arsenal Computer).ISO
/
prg_casm
/
jlvesa11.zip
/
JLVESA17.ASM
< prev
next >
Wrap
Assembly Source File
|
1995-02-24
|
2KB
|
105 lines
; This file is part of JLVESA-library
;
; Copyright 1994 Johannes Lehtinen
; All rights reserved
model large,c
p386
include "jlvesads.asm"
extrn vesa_put_image_on:far
segment jlvesa17_TEXT USE16 'CODE'
assume cs:jlvesa17_TEXT
; void vesa_put_text_on(int x,int y,char *text,void *font)
;
; Outputs string. Font pointer should point to the start of
; font data.
;
; Offset Length Function
;
; 0 512 Offset of data for characters 0-255
;
; 0 2 Width of character
; 2 2 Height of character
; 4 2 Difference in y-coordinate
; 6 2 Empty pixels before character
; 8 2 Empty pixels after character
; 10 ? Character data
x_coord dw ? ; X-coordinate
y_coord dw ? ; Y-coordinate
proc vesa_put_text_on far
public vesa_put_text_on
push bp
mov bp,sp
push si
push di
push ds
push es
; Read address of font and address of string
les di,[ss:bp+14]
lds si,[ss:bp+10]
; Read coordinates
mov ax,[ss:bp+6] ; Read x-coordinate
mov [cs:x_coord],ax
mov ax,[ss:bp+8] ; Read y-coordinate
mov [cs:y_coord],ax
; Draw text one character at time
draw_loop:
mov bp,[ds:si] ; BP is next character
cmp bp,0 ; Check if end of string reached
je short end_loop
shl bp,1 ; Char data at ES:BP
mov bp,[es:di+bp]
mov ax,[es:di+bp] ; AX is width of character
mov bx,[es:di+bp+2] ; BX is height of character
mov cx,[cs:y_coord] ; CX is y-coordinate
add cx,[es:di+bp+4]
mov dx,[es:di+bp+6] ; DX is empty pixels before character
add [cs:x_coord],dx
mov dx,[es:di+bp+8] ; DX is empty pixels after character
add bp,di ; BP is offset in ES
add bp,10
push es ; Output character
push bp
push bx
push ax
push cx
push [cs:x_coord]
add [cs:x_coord],ax
add [cs:x_coord],dx
call far vesa_put_image_on
inc si
jmp short draw_loop
; End drawing
end_loop:
pop es
pop ds
pop di
pop si
pop bp
retf
endp vesa_put_text_on
ends
end